
import express from 'express'
import { json as parserJson } from 'body-parser'
import router from './router/index'

const app = express()
app.use(parserJson()) // 解析json数据 , application/json
// import formidable  from 'express-formidable => app.use(formidable())  解析 fromData数据 

/*** 注册路由 ***/
app.use(router)

const HOST = '0.0.0.0'
const PORT = 8082
app.listen(PORT, HOST, () => {
    console.log(`Listen ${HOST}:${PORT}`)
})